/**
 * 应用常量
 */

// 应用名称
export const APP_NAME = 'NextCollab';

// 应用描述
export const APP_DESCRIPTION = '多人在线实时协作平台，支持项目管理、任务看板、实时编辑、评论与通知';

// 路由路径
export const ROUTES = {
  HOME: '/',
  LOGIN: '/auth/login',
  REGISTER: '/auth/register',
  DASHBOARD: '/dashboard',
  PROFILE: '/profile',
  SETTINGS: '/settings',
  NOTIFICATIONS: '/notifications',
  PROJECTS: '/project',
  NEW_PROJECT: '/project/new',
  PROJECT_DETAIL: (id: string) => `/project/${id}`,
  PROJECT_BOARD: (id: string) => `/project/${id}/board`,
  PROJECT_EDITOR: (id: string) => `/project/${id}/editor`,
  PROJECT_ACTIVITY: (id: string) => `/project/${id}/activity`,
  PROJECT_STATS: (id: string) => `/project/${id}/stats`,
  PROJECT_TEAM: (id: string) => `/project/${id}/team`,
};

// 本地存储键
export const STORAGE_KEYS = {
  THEME: 'nextcollab-theme',
  THEME_COLOR: 'nextcollab-theme-color',
  LANGUAGE: 'nextcollab-language',
  AUTH_TOKEN: 'nextcollab-auth-token',
  USER_SETTINGS: 'nextcollab-user-settings',
};

// 任务状态 - 与Prisma TaskStatus枚举对应
// 使用UI友好的格式，但保持与Prisma模型的映射关系
export const TASK_STATUS = {
  // UI格式: Prisma格式
  TODO: 'todo', // 对应 Prisma TaskStatus.TODO
  IN_PROGRESS: 'in-progress', // 对应 Prisma TaskStatus.IN_PROGRESS
  REVIEW: 'review', // 对应 Prisma TaskStatus.REVIEW
  DONE: 'done', // 对应 Prisma TaskStatus.DONE
};

// Prisma TaskStatus枚举值与UI显示值的映射
export const TASK_STATUS_MAPPING = {
  // Prisma枚举值: UI显示值
  TODO: TASK_STATUS.TODO,
  IN_PROGRESS: TASK_STATUS.IN_PROGRESS,
  REVIEW: TASK_STATUS.REVIEW,
  DONE: TASK_STATUS.DONE,
};

// 任务优先级
export const TASK_PRIORITY = {
  LOW: 'low',
  MEDIUM: 'medium',
  HIGH: 'high',
  URGENT: 'urgent',
};

// 任务标签颜色
export const TAG_COLORS = {
  RED: 'red',
  ORANGE: 'orange',
  YELLOW: 'yellow',
  GREEN: 'green',
  BLUE: 'blue',
  PURPLE: 'purple',
  PINK: 'pink',
  GRAY: 'gray',
};

// 任务状态配置
export const TASK_STATUS_CONFIG = {
  [TASK_STATUS.TODO]: {
    label: '待处理',
    color: 'bg-gray-100 text-gray-800',
    icon: 'CircleIcon',
  },
  [TASK_STATUS.IN_PROGRESS]: {
    label: '进行中',
    color: 'bg-blue-100 text-blue-800',
    icon: 'ClockIcon',
  },
  [TASK_STATUS.REVIEW]: {
    label: '审核中',
    color: 'bg-amber-100 text-amber-800',
    icon: 'EyeIcon',
  },
  [TASK_STATUS.DONE]: {
    label: '已完成',
    color: 'bg-green-100 text-green-800',
    icon: 'CheckCircleIcon',
  },
};

// 任务优先级配置
export const TASK_PRIORITY_CONFIG = {
  [TASK_PRIORITY.LOW]: {
    label: '低',
    color: 'bg-gray-100 text-gray-800',
    icon: 'ArrowDownIcon',
  },
  [TASK_PRIORITY.MEDIUM]: {
    label: '中',
    color: 'bg-blue-100 text-blue-800',
    icon: 'MinusIcon',
  },
  [TASK_PRIORITY.HIGH]: {
    label: '高',
    color: 'bg-amber-100 text-amber-800',
    icon: 'ArrowUpIcon',
  },
  [TASK_PRIORITY.URGENT]: {
    label: '紧急',
    color: 'bg-red-100 text-red-800',
    icon: 'ExclamationTriangleIcon',
  },
};

// 默认分页大小
export const DEFAULT_PAGE_SIZE = 10;

// 最大上传文件大小 (10MB)
export const MAX_UPLOAD_SIZE = 10 * 1024 * 1024;

// 允许的图片类型
export const ALLOWED_IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'];

// 允许的文档类型
export const ALLOWED_DOCUMENT_TYPES = [
  'application/pdf',
  'application/msword',
  'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  'application/vnd.ms-excel',
  'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
  'application/vnd.ms-powerpoint',
  'application/vnd.openxmlformats-officedocument.presentationml.presentation',
  'text/plain',
  'text/csv',
];

// 断点
export const BREAKPOINTS = {
  sm: 640,
  md: 768,
  lg: 1024,
  xl: 1280,
  '2xl': 1536,
}; 